<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        let arr = [12, 32, [34, 55, [22, 35]]]

        // console.log(arr.flat(Infinity));
        function flatFun(arr) {
            let arr2 = []
            for (let i of arr) {
                if (Array.isArray(i)) {
                    arr2 = arr2.concat(flatFun(i))
                } else {
                    arr2.push(i)
                }
            }
            return arr2
        }

        //    console.log(flatFun(arr));

        let timer = '1'
        let money = '10.11'
        console.log(timer.padStart(2, '0'));

        function moneyFun(mon) {
            let money2 = mon.split('.')
            let len = money2[1]
            let str
            if (len) {
                str = money2[0] + '.' + len.padStart(2, '0')
            } else {
                len = ''
                str = money2[0] + '.' + len.padEnd(2, '0')
            }
            return str
        }
       
        // console.log( moneyFun(money));

        let sortArr = [76,88,90,10,23,25,34,57,86]

        function sortFun(arr){
            let arr2 = []
            for (let i = 0; i < arr.length; i++) {
                for (let j = 0; j < arr.length; j++) {
                    if(arr[j+1]<arr[j]){
                        let str = arr[j+1]
                        arr[j+1] = arr[j]
                        arr[j] = str
                    }
                    
                }
                
            }
        }
        sortFun(sortArr)
        // console.log(sortArr);

        let imgStr='weixin.jpg.png'
        console.log(imgStr.endsWith('.jpg'));
        console.log(imgStr.endsWith('.png'));


    </script>

</body>

</html>